/* Summary0.do (STATA)
	Summarize demand shifters.
	by Ralph Koijen & Motohiro Yogo */

#delimit ;
clear all;
set more off;
set type double;

cap log close;
log using Summary0, replace;

/* Define local and global variables */

do global;


/* Load data */

u "../3 Estimation/Estimation0", clear; 

/* Construct latent demand including year fixed effects */

gen epsFE = eps;

foreach var of varlist Iyear_* {;
	replace epsFE = epsFE+b_`var'*`var';
};

/* Table: Mean latent demand for USA */

table year type if counterpart=="USA" & !Iown,
	totals(type) stat(mean epsFE) nformat(%8.1f);

/* Table: Mean latent demand for euro area */

table year type if !country_Ieuro & Ieuro,
	totals(type) stat(mean epsFE) nformat(%8.1f);

log close;
